Skip to content

Clean up template engine after extension modularization#170346

Merged
balloob merged 1 commit into
devfrom
frenck-2026-0480
May 11, 2026
Merged

Clean up template engine after extension modularization#170346
balloob merged 1 commit into
devfrom
frenck-2026-0480

Conversation

@frenck
Copy link
Copy Markdown
Member

@frenck frenck commented May 11, 2026

Proposed change

Small cleanup after the template engine modularization effort:

  • Remove redundant import collections.abc from the state extension (already importing Iterable from collections.abc directly)
  • Move remaining state infrastructure tests (test_invalid_entity_id, test_length_of_states, test_slice_states, test_state_attributes, test_unavailable_states) from test_init.py to test_states.py where they belong

There is no functional change in this PR.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:
  • Link to developer documentation pull request:
  • Link to frontend pull request:

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies a diff between library versions and ideally a link to the changelog/release notes is added to the PR description.

To help with the load of incoming pull requests:

Copilot AI review requested due to automatic review settings May 11, 2026 18:38
@frenck frenck requested a review from a team as a code owner May 11, 2026 18:38
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR performs small cleanup work after template engine modularization by removing a redundant import in the state template extension and relocating state-related template tests into the more appropriate test module.

Changes:

  • Remove redundant collections.abc import and use the already-imported Iterable in StateExtension.expand.
  • Move state infrastructure template tests from test_init.py into test_states.py (no behavioral changes intended).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
tests/helpers/template/test_states.py Adds the moved state-related template tests and required imports/helpers.
tests/helpers/template/test_init.py Removes state-related tests that were relocated to test_states.py.
homeassistant/helpers/template/extensions/state.py Simplifies imports and updates isinstance(..., Iterable) usage accordingly.

@frenck frenck added the smash Indicator this PR is close to finish for merging or closing label May 11, 2026
@balloob balloob merged commit adab0d6 into dev May 11, 2026
49 checks passed
@balloob balloob deleted the frenck-2026-0480 branch May 11, 2026 22:41
raman325 added a commit to raman325/home-assistant that referenced this pull request May 12, 2026
…-timer

* upstream/dev:
  Bump infrared-protocols to 5.1.0 (home-assistant#170365)
  Clean up template engine after extension modularization (home-assistant#170346)
  Bump axis to v71 (home-assistant#170347)
  Enhance WebDAV metadata download with concurrency (home-assistant#170223)
  Add target temperature sensor for ViCare RadiatorActuator devices (home-assistant#170102)
  Bump pyzbar to 0.1.9 (home-assistant#170076)
  homematicip_cloud: fix HmIP-FLC lock state polarity (home-assistant#170159)
  Watts: add timer mode service (home-assistant#169846)
  Set parallel updates for Ecowitt platforms (home-assistant#170349)
  Add config flow to Avea (home-assistant#168070)
  Cleanup Eurotronic number platform (home-assistant#170337)
  Add number platform to eurotronic_cometblue (home-assistant#168119)
@github-actions github-actions Bot locked and limited conversation to collaborators May 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed code-quality core smash Indicator this PR is close to finish for merging or closing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants